package Kuang;

/**
 * description:
 * author:zcx
 * lenovo
 * 时间：2022.02.09.09.16
 */
public class Demo8 {
    public static void main(String[] args) {
        var t=new Myyeild();
        new Thread(t,"A").start();
        new Thread(t,"B").start();
    }


}
class Myyeild implements Runnable {
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + "a");
        Thread.yield();
        System.out.println(Thread.currentThread().getName() + "b");
    }
}
